local thbattle__uuz_lihun = fk.CreateSkill {

  name = "thbattle__uuz_lihun",

  tags = { Skill.Compulsory, },

}



thbattle__uuz_lihun:addEffect(fk.EnterDying, {
  anim_type = "control",
  can_trigger = function(self, event, target, player, data)
    return target ~= player and player:hasSkill(thbattle__uuz_lihun.name) and player.phase ~= Player.NotActive
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    player:drawCards(1, thbattle__uuz_lihun.name)
    if not player:isKongcheng() and not target:isKongcheng() and room:askForSkillInvoke(player, thbattle__uuz_lihun.name, nil, "#thbattle__uuz_lihun:" .. target.id) then
      local pindian = player:pindian({ target }, thbattle__uuz_lihun.name)
      if pindian.results[target].winner == player then
        room:changeMaxHp(target, 1 - player.maxHp)
      else
        room:changeHp(target, 1 - target.hp, "recover", thbattle__uuz_lihun.name)
      end
    end
  end
})

return thbattle__uuz_lihun